/*
 * @Author: weiwang
 * @Date:   2018-12-02 12:41:50
 * @Last Modified by:   weiwang
 * @Last Modified time: 2018-12-02 12:56:16
 */
'use strict';

const Service = require('../core/common');

class AddressesService extends Service {
  findAll(params = {}) {
    const { ctx } = this;

    return ctx.model.Addresses.findAndCountAll(this.paging(params));
  }

  create(where = {}, defaults = {}) {
    const { ctx } = this;

    return ctx.model.Addresses.findOrCreate({ ...where, ...defaults });
  }
}

module.exports = AddressesService;